import request from "@/utils/request.js";
import { APP_ID, H5_APP_ID, TH5_APP_ID } from "@/config/app";

const baseUrl = `/wx/ma/user/${APP_ID}`;
/**
 * 获取用户信息
 */
export function getUserInfo(data) {
  return request.get(`/sso/info`);
}
export function getUserItem(data) {
  return request.get(`/sso/financial/spreadTotal`);
}

/**
 * 修改用户信息
 * @param params
 * @returns {*}
 */
export function updateUserInfoApi(params) {
  return request.post(`/sso/updateProfile`, params);
}

/**
 * 退出登录
 * @param params
 * @returns {*}
 */
export function loginOutApi(params) {
  return request.get(`/sso/logout`, params);
}
// http://192.168.1.213:8085
// http://192.168.3.15:8085
export function authLogin(params) {
  return request.get(`/wx/mp/user/${H5_APP_ID}/auth`, {
    params: params,
  });
}
export function authBindPhoneNumber(params) {
  return request.post(`/wx/mp/user/${H5_APP_ID}/phone`, params);
}
export function getUserCreateTaskApi(params) {
  return request.get(`/member/tax/getQueryTaskPage`, params);
}

export function getUserTaskDetailApi(id) {
  return request.get(`/member/tax/${id}`);
}

export function H5SmsCode(params) {
  return request.get(`/sso/getSmsCode`, {
    params,
  });
}
//账号密码
export function H5LoginPhoneApi(params) {
  return request.post(`/sso/login`, params);
}
//手机号验证码
//
export function accountLoginApi(params) {
  return request.post(`/sso/login/mobile`, params);
}
//注册以及登录
export function apllyLogin(params) {
  return request.post("/sso/register", params);
}

export function getAreaListApi() {
  return request.get(`/product/provinceList`);
}

export function getReportListApi(params) {
  return request.get(`/tax/share/listReport`, {
    params: params,
  });
}

// export function  getReportDetailApi (id) {
//   return request.get(`/tax/share/report/${id}`)
// }
//税票查询分享链接查询数据
export function getReportDetailByShareApi(params) {
  return request.get(`/tax/share/getShareReport`, {
    params: params,
  });
}
//获取企业报告详情
export function getReportDetailApi(params) {
  return request.get(`/tax/share/getEnterpriseReport`, {
    params: params,
  });
}
//助融报告-纳税信息页-其他纳税相关信息
export function getReportDetailInfoApi(params) {
  // return request.get(`/tax/share/getEnterprisePaidTaxesAmount`, {params: params})
  return request.get(`/tax/share/v2/getEnterprisePaidTaxesAmount`, {
    params: params,
  });
}
// 纳税信息-近三年纳税信息表-近3年纳税信息数据
// params-正税/附加税
export function getThreeTaxInfoApi(params) {
  return request.get("/tax/share/v2/getEnterprisePaidTaxesDataList", {
    params: params,
  });
}
//获取企业近三年的申报金额
export function getReportDetailInvoiceApi(params) {
  // return request.get(`/tax/share/getEnterpriseApplyAmount`, {params: params})
  return request.get(`/tax/share/v2/getEnterpriseApplyAmount`, {
    params: params,
  });
}
//获取企业近三年的开票金额
export function getReportDetailInvApi(params) {
  // return request.get(`/tax/share/getEnterpriseApplyAmount`, {params: params})
  return request.get(`/tax/share/v2/getEnterpriseInvoiceInfo`, {
    params: params,
  });
}

//获取企业工商司法信息
export function getReportDetailBusinessApi(params) {
  return request.get(`/tax/share/getEnterpriseCases`, {
    params: params,
  });
}

export function gegetEnterpriseInvoiceTopTenApi(params) {
  return request.get(`/tax/share/getEnterpriseInvoiceTopTen`, {
    params: params,
  });
}
export function getTaxQueryShareNumberApi() {
  return request.get(`/tax/share/getTaxQueryShare`);
}
// 添加注册
export function register(params) {
  return request.post(`/sso/register`, params);
}

//获取取得发票

export function getEnterpriseInvoiceInfoForIn(params) {
  return request.get("/tax/share/v2/getEnterpriseInvoiceInfoForIn", {
    params,
  });
}
//重新查询接口

export function getReturnSearchTax(params) {
  return request.post("/tax/app/loginSms", params);
}
// 发送验证码
export function getReturnSendSms(params) {
  return request.post("/tax/app/sendSms", params);
}
//税务验证码登录
export function getReturnLoginSms(params) {
  return request.post("/tax/app/verifySms", params);
}
/**
 * 提交意见反馈
 * @param params
 * @returns {*}
 */
export function feedbackApi(params) {
  return request.post(`/feedback/comment`, params);
}
//关注企业
export function followEnterpriseApi(params) {
  return request.post(`/follow/enterprise`, params);
}

// 用户关注 动态 账户余额查询
export function getUsrNumApi(params) {
  return request.get("/umsPersonalCenter/getHomeCount", {
    params,
  });
}

//获得个人分销信息

export function getPersonalDistributionInfoApi(params) {
  return request.get("/brokerage/user/get", {
    params,
  });
}

//绑定分销用户
export function bindDistributionUserApi(params) {
  return request.post("/brokerage/user/bind", params);
}
//微信提现
export function wxWithdrawApi(params) {
  return request.post("/brokerage/withdraw/create", params);
}
